<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Basic Configuration Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ctdac__functions__basic.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Basic Configuration Functions<div class="ingroups"><a class="el" href="group__group__ctdac.html">CTDAC        (Continuous Time Digital to Analog Converter)</a> &raquo; <a class="el" href="group__group__ctdac__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions are for configuring basic usage of the CTDAC. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad200575b1f2978c71744791e4a731d9b"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#gad200575b1f2978c71744791e4a731d9b">Cy_CTDAC_SetValue</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, int32_t value)</td></tr>
<tr class="memdesc:gad200575b1f2978c71744791e4a731d9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the CTDAC_VAL register (DAC hardware is updated on the next PeriClk cycle).  <a href="#gad200575b1f2978c71744791e4a731d9b">More...</a><br /></td></tr>
<tr class="separator:gad200575b1f2978c71744791e4a731d9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1524565433728ffa19f773354b88f036"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#ga1524565433728ffa19f773354b88f036">Cy_CTDAC_SetValueBuffered</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, int32_t value)</td></tr>
<tr class="memdesc:ga1524565433728ffa19f773354b88f036"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the CTDAC_VAL_NEXT register.  <a href="#ga1524565433728ffa19f773354b88f036">More...</a><br /></td></tr>
<tr class="separator:ga1524565433728ffa19f773354b88f036"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4356463f9bf1c69c2afdfca69a60b850"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#ga4356463f9bf1c69c2afdfca69a60b850">Cy_CTDAC_SetSignMode</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, <a class="el" href="group__group__ctdac__enums.html#ga52a4e5920c369f3cc51b3618668f02e0">cy_en_ctdac_format_t</a> formatMode)</td></tr>
<tr class="memdesc:ga4356463f9bf1c69c2afdfca69a60b850"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set whether to interpret the DAC value as signed or unsigned.  <a href="#ga4356463f9bf1c69c2afdfca69a60b850">More...</a><br /></td></tr>
<tr class="separator:ga4356463f9bf1c69c2afdfca69a60b850"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga92374004a9bab9201916af6ee54c4f6d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#ga92374004a9bab9201916af6ee54c4f6d">Cy_CTDAC_SetDeepSleepMode</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, <a class="el" href="group__group__ctdac__enums.html#ga08fecfbfc0d670966ae1aabe0db5ff2a">cy_en_ctdac_deep_sleep_t</a> deepSleep)</td></tr>
<tr class="memdesc:ga92374004a9bab9201916af6ee54c4f6d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable or disable the DAC hardware operation in Deep Sleep mode.  <a href="#ga92374004a9bab9201916af6ee54c4f6d">More...</a><br /></td></tr>
<tr class="separator:ga92374004a9bab9201916af6ee54c4f6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf11a41cf842064d44f9f8cdaeea0a31e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#gaf11a41cf842064d44f9f8cdaeea0a31e">Cy_CTDAC_SetOutputMode</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, <a class="el" href="group__group__ctdac__enums.html#ga151d4aa27fabb95182a2494782994ccb">cy_en_ctdac_output_mode_t</a> outputMode)</td></tr>
<tr class="memdesc:gaf11a41cf842064d44f9f8cdaeea0a31e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the output mode of the CTDAC:  <a href="#gaf11a41cf842064d44f9f8cdaeea0a31e">More...</a><br /></td></tr>
<tr class="separator:gaf11a41cf842064d44f9f8cdaeea0a31e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa327e33f705cc55c86c9e4415d28b9ff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#gaa327e33f705cc55c86c9e4415d28b9ff">Cy_CTDAC_SetDeglitchMode</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, <a class="el" href="group__group__ctdac__enums.html#gaa5bbaaf21bda846a109573f84f1e2735">cy_en_ctdac_deglitch_t</a> deglitchMode)</td></tr>
<tr class="memdesc:gaa327e33f705cc55c86c9e4415d28b9ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable deglitching on the unbuffered path, buffered path, both, or disable deglitching.  <a href="#gaa327e33f705cc55c86c9e4415d28b9ff">More...</a><br /></td></tr>
<tr class="separator:gaa327e33f705cc55c86c9e4415d28b9ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1023b3cf97003859e12ced716a557d83"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#ga1023b3cf97003859e12ced716a557d83">Cy_CTDAC_SetDeglitchCycles</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, uint32_t deglitchCycles)</td></tr>
<tr class="memdesc:ga1023b3cf97003859e12ced716a557d83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the number of deglitch cycles (0 to 63) that will be used.  <a href="#ga1023b3cf97003859e12ced716a557d83">More...</a><br /></td></tr>
<tr class="separator:ga1023b3cf97003859e12ced716a557d83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3e645d5bdf428353fc09461b24a3352f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__basic.html#ga3e645d5bdf428353fc09461b24a3352f">Cy_CTDAC_SetRef</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, <a class="el" href="group__group__ctdac__enums.html#ga9c4416c55b96c81979223ec469eb7e0e">cy_en_ctdac_ref_source_t</a> refSource)</td></tr>
<tr class="memdesc:ga3e645d5bdf428353fc09461b24a3352f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the CTDAC reference source to Vdda or an external reference.  <a href="#ga3e645d5bdf428353fc09461b24a3352f">More...</a><br /></td></tr>
<tr class="separator:ga3e645d5bdf428353fc09461b24a3352f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gad200575b1f2978c71744791e4a731d9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad200575b1f2978c71744791e4a731d9b">&#9670;&nbsp;</a></span>Cy_CTDAC_SetValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CTDAC_SetValue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the CTDAC_VAL register (DAC hardware is updated on the next PeriClk cycle). </p>
<p>Only the least significant 12 bits have an effect. Sign extension of negative values is unnecessary and is ignored by the hardware. The way in which the CTDAC interprets the 12-bit data is controlled by <a class="el" href="group__group__ctdac__functions__basic.html#ga4356463f9bf1c69c2afdfca69a60b850">Cy_CTDAC_SetSignMode</a>.</p>
<dl class="section note"><dt>Note</dt><dd>Call this function only when the update mode is set to <a class="el" href="group__group__ctdac.html#group_ctdac_updatemode_direct_write">Direct write</a>. Calling this function for any other update mode will not have the intended effect.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">value</td><td>Value to write into the CTDAC_VAL register</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: The update mode has been configured for Direct writes.</span></div><div class="line"><span class="comment">     * To update the DAC value in this mode, Cy_CTDAC_SetValue() must be called. */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Output Vref/2 (unsigned mode). */</span></div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#gad200575b1f2978c71744791e4a731d9b">Cy_CTDAC_SetValue</a>(CTDAC0, 0x800);</div><div class="line">    </div><div class="line">    <span class="comment">/* DAC output is updated on the next PeriClk cycle. */</span></div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
<a id="ga1524565433728ffa19f773354b88f036"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1524565433728ffa19f773354b88f036">&#9670;&nbsp;</a></span>Cy_CTDAC_SetValueBuffered()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CTDAC_SetValueBuffered </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the CTDAC_VAL_NEXT register. </p>
<p>The value is transferred to the CTDAC_VAL register on the next edge of the CTDAC clock. Only the least significant 12 bits have an effect. Sign extension of negative values is unnecessary and is ignored by the hardware. The way in which the CTDAC interprets the 12-bit data is controlled by <a class="el" href="group__group__ctdac__functions__basic.html#ga4356463f9bf1c69c2afdfca69a60b850">Cy_CTDAC_SetSignMode</a>.</p>
<dl class="section note"><dt>Note</dt><dd>Calling this function in <a class="el" href="group__group__ctdac.html#group_ctdac_updatemode_direct_write">Direct write</a> mode will not update the DAC output. Call this function for all modes that use buffered values (i.e. uses a clock).</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">value</td><td>Value to write into the CTDAC_VAL_NEXT register</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: The update mode has been configured for Buffered writes.</span></div><div class="line"><span class="comment">     * To update the DAC value in this mode, a clock is required and</span></div><div class="line"><span class="comment">     * Cy_CTDAC_SetValueBuffered() is used. */</span></div><div class="line">        </div><div class="line">    <span class="comment">/* Output Vref/2 (signed mode). */</span></div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#ga1524565433728ffa19f773354b88f036">Cy_CTDAC_SetValueBuffered</a>(CTDAC0, 0x000);   </div><div class="line">    </div><div class="line">    <span class="comment">/* The rising edge of the DAC clock initiates an update to the DAC value.</span></div><div class="line"><span class="comment">     * Wait for an interrupt to signal that the DAC is ready for a new value. */</span></div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
<a id="ga4356463f9bf1c69c2afdfca69a60b850"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4356463f9bf1c69c2afdfca69a60b850">&#9670;&nbsp;</a></span>Cy_CTDAC_SetSignMode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTDAC_SetSignMode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctdac__enums.html#ga52a4e5920c369f3cc51b3618668f02e0">cy_en_ctdac_format_t</a>&#160;</td>
          <td class="paramname"><em>formatMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set whether to interpret the DAC value as signed or unsigned. </p>
<p>In unsigned mode, the DAC value register is used without any decoding. In signed mode, the MSB is inverted by adding 0x800 to the DAC value. This converts the lowest signed number, 0x800, to the lowest unsigned number, 0x000.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">formatMode</td><td>Mode can be signed or unsigned. See <a class="el" href="group__group__ctdac__enums.html#ga52a4e5920c369f3cc51b3618668f02e0">cy_en_ctdac_format_t</a> for values.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Set the format of the DAC value register to be signed. */</span></div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#ga4356463f9bf1c69c2afdfca69a60b850">Cy_CTDAC_SetSignMode</a>(CTDAC0, <a class="code" href="group__group__ctdac__enums.html#gga52a4e5920c369f3cc51b3618668f02e0ad7396b32a7ac35fe30197b985a323c38">CY_CTDAC_FORMAT_SIGNED</a>);</div></div><!-- fragment -->
</div>
</div>
<a id="ga92374004a9bab9201916af6ee54c4f6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga92374004a9bab9201916af6ee54c4f6d">&#9670;&nbsp;</a></span>Cy_CTDAC_SetDeepSleepMode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTDAC_SetDeepSleepMode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctdac__enums.html#ga08fecfbfc0d670966ae1aabe0db5ff2a">cy_en_ctdac_deep_sleep_t</a>&#160;</td>
          <td class="paramname"><em>deepSleep</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable or disable the DAC hardware operation in Deep Sleep mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">deepSleep</td><td>Enable or disable Deep Sleep operation. Select value from <a class="el" href="group__group__ctdac__enums.html#ga08fecfbfc0d670966ae1aabe0db5ff2a">cy_en_ctdac_deep_sleep_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: The CTDAC is used as the reference voltage for a comparator</span></div><div class="line"><span class="comment">     * to wake up the device from Deep Sleep mode. The comparator has been configured</span></div><div class="line"><span class="comment">     * to operate in Deep Sleep mode. */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Keep the CTDAC on in Deep Sleep mode. */</span></div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#ga92374004a9bab9201916af6ee54c4f6d">Cy_CTDAC_SetDeepSleepMode</a>(CTDAC0, <a class="code" href="group__group__ctdac__enums.html#gga08fecfbfc0d670966ae1aabe0db5ff2aae31913053d33b3e08828568d5c3ac335">CY_CTDAC_DEEPSLEEP_ENABLE</a>);</div></div><!-- fragment -->
</div>
</div>
<a id="gaf11a41cf842064d44f9f8cdaeea0a31e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf11a41cf842064d44f9f8cdaeea0a31e">&#9670;&nbsp;</a></span>Cy_CTDAC_SetOutputMode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTDAC_SetOutputMode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctdac__enums.html#ga151d4aa27fabb95182a2494782994ccb">cy_en_ctdac_output_mode_t</a>&#160;</td>
          <td class="paramname"><em>outputMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the output mode of the CTDAC: </p>
<ul>
<li><a class="el" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccbaa3e1dfa33392b66a111cffdeb0df4527">CY_CTDAC_OUTPUT_HIGHZ</a> : Disable the output</li>
<li><a class="el" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccbaa0eedb42bfda13365d835dcc21ef33e6">CY_CTDAC_OUTPUT_VALUE</a> : Enable the output and drive the value stored in the CTDAC_VAL register.</li>
<li><a class="el" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccba9d9e4e7c8dfcab9f6ef32358937709c8">CY_CTDAC_OUTPUT_VALUE_PLUS1</a> : Enable the output and drive the value stored in the CTDAC_VAL register plus 1.</li>
<li><a class="el" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccba640a9cb727d264dc0dadae6586a2f8a8">CY_CTDAC_OUTPUT_VSSA</a> : Output pulled to VSSA through 1.1 MOhm (typ) resistor.</li>
<li><a class="el" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccba2c8da77139224fb4e7f913cb48556f6d">CY_CTDAC_OUTPUT_VREF</a> : Output pulled to VREF through 1.1 MOhm (typ) resistor.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">outputMode</td><td>Select a value from <a class="el" href="group__group__ctdac__enums.html#ga151d4aa27fabb95182a2494782994ccb">cy_en_ctdac_output_mode_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: The Sample and Hold (S/H) capacitor in the CTB block is used to</span></div><div class="line"><span class="comment">     * maintain the DAC output voltage for a duration of time so that</span></div><div class="line"><span class="comment">     * the DAC output can be turned off to save power. */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Turn off DAC output. */</span></div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#gaf11a41cf842064d44f9f8cdaeea0a31e">Cy_CTDAC_SetOutputMode</a>(CTDAC0, <a class="code" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccbaa3e1dfa33392b66a111cffdeb0df4527">CY_CTDAC_OUTPUT_HIGHZ</a>);</div><div class="line">    </div><div class="line">    <span class="comment">/* The DAC output will need to turn on and sampled periodically to maintain</span></div><div class="line"><span class="comment">     * an acceptable voltage level across the S/H capacitor. */</span></div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
<a id="gaa327e33f705cc55c86c9e4415d28b9ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa327e33f705cc55c86c9e4415d28b9ff">&#9670;&nbsp;</a></span>Cy_CTDAC_SetDeglitchMode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTDAC_SetDeglitchMode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctdac__enums.html#gaa5bbaaf21bda846a109573f84f1e2735">cy_en_ctdac_deglitch_t</a>&#160;</td>
          <td class="paramname"><em>deglitchMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable deglitching on the unbuffered path, buffered path, both, or disable deglitching. </p>
<p>The deglitch mode should match the configured output path.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">deglitchMode</td><td>Deglitching mode selection. See <a class="el" href="group__group__ctdac__enums.html#gaa5bbaaf21bda846a109573f84f1e2735">cy_en_ctdac_deglitch_t</a> for values.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: The CTDAC is configured to stay on in Deep Sleep mode.</span></div><div class="line"><span class="comment">     * Before entering Deep Sleep mode, the deglitch switches must be</span></div><div class="line"><span class="comment">     * turned off so that switches along the output path are guaranteed to be closed. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#gaa327e33f705cc55c86c9e4415d28b9ff">Cy_CTDAC_SetDeglitchMode</a>(CTDAC0, <a class="code" href="group__group__ctdac__enums.html#ggaa5bbaaf21bda846a109573f84f1e2735ac297e08904e92c27a89c93376be1c4af">CY_CTDAC_DEGLITCHMODE_NONE</a>);</div></div><!-- fragment -->
</div>
</div>
<a id="ga1023b3cf97003859e12ced716a557d83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1023b3cf97003859e12ced716a557d83">&#9670;&nbsp;</a></span>Cy_CTDAC_SetDeglitchCycles()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTDAC_SetDeglitchCycles </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>deglitchCycles</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the number of deglitch cycles (0 to 63) that will be used. </p>
<p>To calculate the deglitch time: </p><pre class="fragment">  (DEGLITCH_CNT + 1) / PERI_CLOCK_FREQ
</pre><p>The optimal deglitch time is 700 ns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">deglitchCycles</td><td>Number of cycles to deglitch</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: The PeriClk frequency has been changed during run-time.</span></div><div class="line"><span class="comment">     * Update the deglitch cycles so that the optimal deglitch time of 700 ns</span></div><div class="line"><span class="comment">     * can be maintained. */</span></div><div class="line"><span class="preprocessor">    #define PERICLK_FREQ_MHZ                (50)</span></div><div class="line"><span class="preprocessor">    #define DEGLITCH_TARGET_TIME_NS         (700uL)</span></div><div class="line"><span class="preprocessor">    #define FACTOR_NANO_TO_MICRO            (1000uL)</span></div><div class="line">    </div><div class="line">    uint32_t deglitchCycles = ((PERICLK_FREQ_MHZ * DEGLITCH_TARGET_TIME_NS) / FACTOR_NANO_TO_MICRO) - 1uL;</div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#ga1023b3cf97003859e12ced716a557d83">Cy_CTDAC_SetDeglitchCycles</a>(CTDAC0, deglitchCycles);</div></div><!-- fragment -->
</div>
</div>
<a id="ga3e645d5bdf428353fc09461b24a3352f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3e645d5bdf428353fc09461b24a3352f">&#9670;&nbsp;</a></span>Cy_CTDAC_SetRef()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTDAC_SetRef </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctdac__enums.html#ga9c4416c55b96c81979223ec469eb7e0e">cy_en_ctdac_ref_source_t</a>&#160;</td>
          <td class="paramname"><em>refSource</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the CTDAC reference source to Vdda or an external reference. </p>
<p>The external reference must come from Opamp1 of the CTB.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">refSource</td><td>The reference source. Select a value from <a class="el" href="group__group__ctdac__enums.html#ga9c4416c55b96c81979223ec469eb7e0e">cy_en_ctdac_ref_source_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Change the reference source of the CTDAC to be VDDA</span></div><div class="line"><span class="comment">     * so that no buffers from the CTB are needed. */</span></div><div class="line">    <a class="code" href="group__group__ctdac__functions__basic.html#ga3e645d5bdf428353fc09461b24a3352f">Cy_CTDAC_SetRef</a>(CTDAC0, <a class="code" href="group__group__ctdac__enums.html#gga9c4416c55b96c81979223ec469eb7e0ead259b9dd0e37537ea74be700fbe554f4">CY_CTDAC_REFSOURCE_VDDA</a>);</div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
